#include "DrawList.h"
#include "DrawNode.h"

DrawList::DrawList()
{
	head = NULL;
}

DrawList::~DrawList()
{
	if(head)
		delete head;
	head = NULL;
}

void DrawList::push(DrawNode* node)
{
	//if head != null
	head?node->setNextNode(head):0;
	head = node;
}

DrawNode* DrawList::pop()
{
	if(head)
	{
		DrawNode* temp;
		temp = head;
		head = temp->getNextNode();
		temp->setNextNode(NULL);
		return temp;
	}
	return NULL;
}